home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 February / macformat-034.iso / mac / Shareware City / Applications / Laughing Bird Folder / The Laughing Bird Restaurant / The Laughing Bird Restaurant.dxr / 00356_MovieScript 1.ls < prev    next >
Encoding:
Text File  |  1995-12-16  |  22.9 KB  |  652 lines

  1. on startMovie
  2.   global gpushCurs, gPushCursNum, gThanxshowing, gAddButtonOn, gAddEdit, gWhichMenu, gMenuWindow, gMenus, gPasswordList, gPassword, gRandomCode, gOpenGates, gMacOrWin, myPrinter, cpuType, gOldColorDepth
  3.   set gOpenGates to 0
  4.   set the keyDownScript to "CommandQuit"
  5.   if the text of field "CodeNumber" = "52" then
  6.     put random(51) into field "CodeNumber"
  7.     go("Loading")
  8.   else
  9.     go("Start")
  10.   end if
  11.   if gOpenGates = 0 then
  12.     set gWhichMenu to "ShowAllMenu 2"
  13.   end if
  14.   if gOpenGates = 1 then
  15.     set gWhichMenu to "ShowAllMenu"
  16.   end if
  17.   set gThanxshowing to 0
  18.   set gAddButtonOn to 1
  19.   set gAddEdit to 0
  20.   set gPushCursNum to the number of cast "Pusher"
  21.   set gpushCurs to [gPushCursNum, gPushCursNum + 1]
  22.   set gMenus to the number of cast "PastaMenu"
  23.   set gMenuWindow to 15
  24.   if the machineType = 256 then
  25.     set cpuType to #mpc
  26.     set gMacOrWin to "W"
  27.   else
  28.     set cpuType to #mac
  29.     set gMacOrWin to "M"
  30.   end if
  31.   if cpuType = #mpc then
  32.     openXLib("Print_X")
  33.   end if
  34.   if objectp(myPrinter) then
  35.     myPrinter(mdispose)
  36.   end if
  37.   set gOldColorDepth to the colorDepth
  38.   updateStage()
  39.   set the colorDepth to 8
  40.   set the visible of sprite 25 to 0
  41.   set the visible of sprite 30 to 0
  42.   set the visible of sprite 31 to 0
  43.   if the text of field "PersonalMenu" = EMPTY then
  44.     put "EMPTY" into line 1 of field "PersonalMenu"
  45.   else
  46.     nothing()
  47.   end if
  48.   set the foreColor of field "PersonalMenu" to 5
  49.   set the textFont of field "Count" to "Cartoon"
  50.   set the textSize of field "Count" to 28
  51.   set the foreColor of field "Count" to 5
  52.   set the textFont of field "SeenCodeNumber" to "GENEVA"
  53.   set the textSize of field "SeenCodeNumber" to 18
  54.   set the foreColor of field "SeenCodeNumber" to 5
  55.   set the text of field "SeenCodeNumber" to "11" & gMacOrWin & the text of field "CodeNumber"
  56.   updateStage()
  57.   set the textFont of field "AccessCode Text" to "geneva"
  58.   set the textSize of field "AccessCode Text" to 10
  59.   set the foreColor of field "AccessCode Text" to 5
  60.   set the backColor of cast "AccessCode Text" to 255
  61.   set the text of field "AccessCode Text" to "Access Code: 11" & gMacOrWin & the text of field "CodeNumber"
  62.   updateStage()
  63.   set the textFont of field "EnterPassword" to "geneva"
  64.   set the textSize of field "EnterPassword" to 14
  65.   set the foreColor of field "EnterPassword" to 255
  66.   set the backColor of cast "EnterPassword" to 0
  67.   set the text of field "EnterPassword" to "Password?"
  68.   set the textFont of field "PrintField" to "Kabel Demi"
  69.   set the textSize of field "PrintField" to 14
  70.   set the foreColor of field "PrintField" to 5
  71.   set the text of field "EditField" to the text of field "PersonalMenu"
  72.   set the textFont of field "EditField" to "Kabel Demi"
  73.   set the textSize of field "EditField" to 14
  74.   set the foreColor of field "EditField" to 5
  75.   set the text of field "EditMode" to the text of field "PersonalMenu"
  76.   set the textFont of field "EditMode" to "Kabel Demi"
  77.   set the textSize of field "EditMode" to 14
  78.   set the foreColor of field "EditMode" to 5
  79.   set the backColor of cast "EditMode" to 255
  80.   set the textFont of field "EnterNewRecipe" to "Kabel Demi"
  81.   set the textSize of field "EnterNewRecipe" to 12
  82.   set the foreColor of field "EnterNewRecipe" to 255
  83.   set the textFont of field "Title Of New Recipe" to "Kabel Demi"
  84.   set the textSize of field "Title Of New Recipe" to 12
  85.   set the foreColor of field "Title Of New Recipe" to 255
  86.   set the textFont of field "PersonalMenu" to "Kabel Demi"
  87.   set the textSize of field "PersonalMenu" to 14
  88.   set the foreColor of field "PersonalMenu" to 5
  89.   set the textFont of field "NumLeft field" to "Geneva"
  90.   set the textSize of field "NumLeft field" to 14
  91.   set the textStyle of field "NumLeft field" to "Bold"
  92.   set the foreColor of field "NumLeft field" to 35
  93.   set the backColor of cast "NumLeft field" to 255
  94.   set the text of field "NumLeft field" to "8"
  95.   set gPasswordList to ["Bake-LB", "Baking-LB", "barbecue-LB", "baste-LB", "Bird-LB", "Bowl-LB", "bread-LB", "breakfast-LB", "broil-LB", "California-LB", "chef-LB", "cook-LB", "cooking-LB", "dinner-LB", "doughnut-LB", "Drink-LB", "eat-LB", "fire-LB", "food-LB", "Fork-LB", "fried-LB", "frying-LB", "glass-LB", "halibut-LB", "hungry-LB", "Kitchen-LB", "knife-LB", "Laughing-LB", "lunch-LB", "meal-LB", "Miami-LB", "Napkin-LB", "Pan-LB", "Pepper-LB", "Picnic-LB", "PlaceMat-LB", "Plate-LB", "pots-LB", "Restaurant-LB", "salad-LB", "Salt-LB", "Shishkabob-LB", "silverware-LB", "skillet-LB", "snack-LB", "soup-LB", "Spoon-LB", "stir-LB", "Table-LB", "taste-LB", "water-LB", "NOCODE"]
  96.   set gPassword to getAt(gPasswordList, integer(field "codeNumber"))
  97.   if the text of field "Password" = gPassword then
  98.     set gOpenGates to 1
  99.   else
  100.     set gOpenGates to 0
  101.   end if
  102. end
  103.  
  104. on YellowIt
  105.   set gallList to [1, 3, 5, 7, 9, 14, 21, 30, 35, 42, 45, 50, 61, 75, 135, 140, 142, 150, 159, 169]
  106.   repeat with n = 1 to 20
  107.     set the foreColor of line getAt(gallList, n) + 4 of field "showALlMenu 2" to 5
  108.   end repeat
  109. end
  110.  
  111. on stopMovie
  112.   global gOldColorDepth
  113.   set the colorDepth to gOldColorDepth
  114.   updateStage()
  115.   if cpuType = #mac then
  116.     closeXLib("PrintXObj")
  117.   else
  118.     if the machineType = 256 then
  119.       closeXLib("Print_X")
  120.     end if
  121.   end if
  122. end
  123.  
  124. on Checkit
  125.   if (the key = RETURN) or (the key = TAB) or (the key = ENTER) then
  126.     dontPassEvent()
  127.     go(#next)
  128.     set downcount to integer(the text of field "Numleft field")
  129.     put downcount - 1 into field "numleft field"
  130.   end if
  131. end
  132.  
  133. on NoReturn
  134.   if (the key = RETURN) or (the key = TAB) or (the key = ENTER) then
  135.     dontPassEvent()
  136.     nothing()
  137.   end if
  138. end
  139.  
  140. on CommandQuit
  141.   if the commandDown and (the key = ".") then
  142.     QuitNow()
  143.   end if
  144. end
  145.  
  146. on EnterRoll
  147.   if rollOver(4) then
  148.     set the castNum of sprite 4 to the number of cast "EnterRoll"
  149.   else
  150.     set the castNum of sprite 4 to the number of cast "EnterUp"
  151.     updateStage()
  152.   end if
  153. end
  154.  
  155. on EnterRestaurant
  156.   global gOpenGates, gPasswordList, gPassword, gWhichMenu
  157.   if gOpenGates = 1 then
  158.     puppetSprite(4, 0)
  159.     set gWhichMenu to "showAllMenu"
  160.     go("Main")
  161.   else
  162.     set gPassword to getAt(gPasswordList, integer(field "codeNumber"))
  163.     put getAt(gPasswordList, integer(field "codeNumber")) into field "Password"
  164.     updateStage()
  165.     puppetSprite(4, 0)
  166.     go("Password")
  167.   end if
  168. end
  169.  
  170. on GoPassword
  171.   go("password")
  172. end
  173.  
  174. on ActiveRecipes
  175.   global gOpenGates, gWhichMenu
  176.   set PoultryList to [4, 10, 17]
  177.   set SeaList to [4, 10, 16]
  178.   set MeatList to [4, 10]
  179.   set AppsList to [4, 10, 16]
  180.   set ExtraList to [6, 13, 25]
  181.   set PastaList to [4, 9, 15]
  182.   set DessertList to [4, 10, 15]
  183.   if the foreColor of word 3 of line 2 of field gWhichMenu = 5 then
  184.     nothing()
  185.   else
  186.     set the foreColor of field gWhichMenu to 246
  187.     put "Recipes in YELLOW are the active recipes in this demo" into line 2 of field gWhichMenu
  188.     set the foreColor of word 3 of line 2 of field gWhichMenu to 5
  189.     set the textSize of line 2 of field gWhichMenu to 10
  190.     updateStage()
  191.     if the name of cast gWhichMenu = "PoultryMenu" then
  192.       repeat with n = 1 to 3
  193.         set theOffset to getAt(PoultryList, n)
  194.         put theOffset
  195.         set the foreColor of line getAt(PoultryList, n) of field the castNum of sprite 15 to 5
  196.         updateStage()
  197.       end repeat
  198.     end if
  199.     if the name of cast gWhichMenu = "SeaMenu" then
  200.       repeat with n = 1 to 3
  201.         set the foreColor of line getAt(SeaList, n) of field the castNum of sprite 15 to 5
  202.         updateStage()
  203.       end repeat
  204.     end if
  205.     if the name of cast gWhichMenu = "MeatMenu" then
  206.       repeat with n = 1 to 2
  207.         set the foreColor of line getAt(MeatList, n) of field the castNum of sprite 15 to 5
  208.         updateStage()
  209.       end repeat
  210.     end if
  211.     if the name of cast gWhichMenu = "AppsMenu" then
  212.       repeat with n = 1 to 3
  213.         set the foreColor of line getAt(AppsList, n) of field the castNum of sprite 15 to 5
  214.         updateStage()
  215.       end repeat
  216.     end if
  217.     if the name of cast gWhichMenu = "ExtraMenu" then
  218.       repeat with n = 1 to 3
  219.         set the foreColor of line getAt(ExtraList, n) of field the castNum of sprite 15 to 5
  220.         updateStage()
  221.       end repeat
  222.     end if
  223.     if the name of cast gWhichMenu = "PastaMenu" then
  224.       repeat with n = 1 to 3
  225.         set the foreColor of line getAt(PastaList, n) of field the castNum of sprite 15 to 5
  226.         updateStage()
  227.       end repeat
  228.     end if
  229.     if the name of cast gWhichMenu = "DessertMenu" then
  230.       repeat with n = 1 to 3
  231.         set the foreColor of line getAt(DessertList, n) of field the castNum of sprite 15 to 5
  232.         updateStage()
  233.       end repeat
  234.     end if
  235.   end if
  236. end
  237.  
  238. on AllRecipes
  239.   global gWhichMenu
  240.   set the foreColor of line 2 of field gWhichMenu to 5
  241.   put " " into line 2 of field gWhichMenu
  242.   updateStage()
  243.   if the foreColor of field the castNum of sprite 15 = 5 then
  244.     nothing()
  245.   else
  246.     set the foreColor of field the castNum of sprite 15 to 5
  247.     updateStage()
  248.   end if
  249. end
  250.  
  251. on WriteInfo
  252.   global gMacOrWin
  253.   set the textSize of field "FullInfo" to 14
  254.   put "E-Mail address: " & the text of field "E-Mail" & RETURN & "Name on check: " & the text of field "Name" & RETURN & "Phone Number: " & the text of field "PhoneNum" & RETURN & "Check Number: " & the text of field "CheckNum" & RETURN & "Amount of Check: " & the text of field "Amount" & RETURN & "Bank: " & the text of field "BankName" & RETURN & "Bank routing numbers: " & the text of field "BottomNums" & RETURN & "Comments: " & the text of field "Comments" & RETURN & "Access Code: 11" & gMacOrWin & the text of field "CodeNumber" && " (don't delete this number!)" & RETURN & RETURN & "Please E-Mail the above info to: lafingbird@aol.com" into field "FullInfo"
  255. end
  256.  
  257. on PrintInfo
  258.   global gMacOrWin
  259.   set the textSize of field "FullInfo2" to 14
  260.   put "To: Laughing Bird Productions" & RETURN & "P.O.Box 807" & RETURN & "Dakota City, Nebraska" & RETURN & "68731" & RETURN & "- - - - - - - - - - - - - - - - - - - - - -" & RETURN & RETURN & "E-Mail Address: " & the text of field "E-Mail" & RETURN & "Name: " & the text of field "Name" & RETURN & "Amount of Check: " & the text of field "Amount" & RETURN & "Access Code: 11" & gMacOrWin & the text of field "CodeNumber" && " (don't delete this number!)" & RETURN & RETURN & "Additional comments?" into field "FullInfo2"
  261.   printInfoNow()
  262. end
  263.  
  264. on CategoryRoll
  265.   if the visible of sprite 20 = 1 then
  266.     nothing()
  267.   else
  268.     set roller to 3
  269.     set startCast to the number of cast "PastaUp"
  270.     repeat with n = 0 to 8
  271.       if rollOver(roller + n) then
  272.         set the castNum of sprite (roller + n) to startCast + 1 + (n * 5)
  273.         next repeat
  274.       end if
  275.       set the castNum of sprite (roller + n) to startCast + (n * 5)
  276.       updateStage()
  277.     end repeat
  278.   end if
  279. end
  280.  
  281. on PersonalRoll
  282.   global gAddEdit
  283.   if the visible of sprite 20 = 1 then
  284.     nothing()
  285.   else
  286.     if gAddEdit = 0 then
  287.       if rollOver(12) then
  288.         set the castNum of sprite 12 to the number of cast "PersonalRoll"
  289.       else
  290.         set the castNum of sprite 12 to the number of cast "PersonalUp"
  291.         updateStage()
  292.       end if
  293.     end if
  294.     if gAddEdit = 1 then
  295.       if rollOver(12) then
  296.         set the castNum of sprite 12 to the number of cast "Add/EditRoll"
  297.       else
  298.         set the castNum of sprite 12 to the number of cast "Add/EditUp"
  299.         updateStage()
  300.       end if
  301.     end if
  302.   end if
  303. end
  304.  
  305. on CategoryButton
  306.   global gMenuWindow, gCatagory, gOpenGates, gAddEdit, gWhichMenu, gTheClickedCast
  307.   if the castNum of sprite 12 = the number of cast "Add/EditUp" then
  308.     set the castNum of sprite 12 to the number of cast "PersonalUp"
  309.   end if
  310.   set gAddEdit to 0
  311.   set Whichcast to the mouseCast
  312.   if the mouseCast = the number of cast gTheClickedCast then
  313.     set the castNum of sprite 15 to the number of cast "Dot"
  314.     puppetTransition(10, 1, 10)
  315.     updateStage()
  316.     if gWhichMenu = "ShowAllMenu 2" then
  317.       set the castNum of sprite 15 to the number of cast Whichcast + 12
  318.     else
  319.       set the castNum of sprite 15 to the number of cast Whichcast + 3
  320.     end if
  321.     puppetTransition(9, 1, 10)
  322.     updateStage()
  323.     set the castNum of sprite 16 to the number of cast Whichcast + 2
  324.     set gCatagory to the name of cast (Whichcast + 2)
  325.     updateStage()
  326.     set the textSize of line 1 of field gWhichMenu to 18
  327.     updateStage()
  328.     if gOpenGates = 0 then
  329.       ActiveRecipes()
  330.     else
  331.       AllRecipes()
  332.     end if
  333.   else
  334.     nothing()
  335.   end if
  336. end
  337.  
  338. on RecipeSelect
  339.   global theChoice, gPersonalSelected
  340.   set vname to theChoice
  341.   if vname = 0 then
  342.     exit
  343.   else
  344.     put the text of cast vname into field "Printfield"
  345.   end if
  346.   updateStage()
  347.   initPush(2, 12, 0)
  348.   init(15, 16, 0)
  349.   set gPersonalSelected to 0
  350. end
  351.  
  352. on PersonalCategoryButton
  353.   global gMenuWindow, gCatagory, gAddEdit, gTheClickedCast
  354.   set Whichcast to the mouseCast
  355.   if the mouseCast = the number of cast gTheClickedCast then
  356.     set the castNum of sprite gMenuWindow to the number of cast "Dot"
  357.     puppetTransition(10, 1, 10)
  358.     updateStage()
  359.     set the castNum of sprite gMenuWindow to the number of cast Whichcast + 3
  360.     puppetTransition(9, 1, 10)
  361.     updateStage()
  362.     set the castNum of sprite 16 to the number of cast Whichcast + 2
  363.     set gCatagory to the name of cast (Whichcast + 2)
  364.     updateStage()
  365.     puppetSprite(19, 1)
  366.     set the castNum of sprite 19 to the number of cast "Add buttonUP"
  367.     puppetTransition(9, 1, 10)
  368.     updateStage()
  369.     set the visible of sprite 25 to 1
  370.     set the foreColor of sprite 15 to 5
  371.     updateStage()
  372.     repeat with PersonalButtonFlash = 279 to 281
  373.       set the castNum of sprite 12 to PersonalButtonFlash
  374.       updateStage()
  375.       wait(2)
  376.     end repeat
  377.     puppetSound("GlowSound")
  378.     repeat with PersonalButtonFlash = 281 down to 279
  379.       set the castNum of sprite 12 to PersonalButtonFlash
  380.       updateStage()
  381.       wait(2)
  382.     end repeat
  383.     set the castNum of sprite 12 to the number of cast "Add/EditUp"
  384.     set gAddEdit to 1
  385.     puppetTransition(9, 1, 10)
  386.     updateStage()
  387.   else
  388.     nothing()
  389.   end if
  390. end
  391.  
  392. on PersonalRecipeSelect
  393.   global theChoice, gPersonalSelected, gNewRecipe
  394.   set vname to theChoice
  395.   set the text of field "Printfield" to gNewRecipe && RETURN && RETURN & the text of field gNewRecipe
  396.   updateStage()
  397.   initPush(2, 12, 0)
  398.   init(15, 16, 0)
  399.   puppetSprite(25, 0)
  400.   set gPersonalSelected to 1
  401. end
  402.  
  403. on AddButton
  404.   initPush(3, 12, 0)
  405.   puppetSprite(19, 0)
  406.   init(15, 16, 0)
  407.   go("add your own")
  408. end
  409.  
  410. on About
  411.   set the visible of sprite 20 to 1
  412.   puppetTransition(9, 1, 5)
  413.   updateStage()
  414. end
  415.  
  416. on PrintMainQuitRoll
  417.   set roller to 4
  418.   set startCast to the number of cast "printUp"
  419.   repeat with n = 0 to 1
  420.     if rollOver(roller + n) then
  421.       set the castNum of sprite (roller + n) to startCast + 1 + (n * 3)
  422.       next repeat
  423.     end if
  424.     set the castNum of sprite (roller + n) to startCast + (n * 3)
  425.     updateStage()
  426.   end repeat
  427. end
  428.  
  429. on GoMain
  430.   global gAddButtonOn, gAddEdit
  431.   initPush(4, 13, 0)
  432.   set the castNum of sprite 19 to the number of cast "Dot"
  433.   updateStage()
  434.   set the visible of sprite 25 to 0
  435.   go("Main")
  436.   set the visible of sprite 14 to 1
  437.   set the visible of sprite 9 to 1
  438.   set the visible of sprite 10 to 1
  439.   set gAddEdit to 0
  440.   set gAddButtonOn to 1
  441.   set the visible of sprite 16 to 1
  442. end
  443.  
  444. on NextRecipe
  445.   global gPersonalSelected, gLastCast
  446.   set gLastCast to the number of cast "EnterNewRecipe"
  447.   if gPersonalSelected = 0 then
  448.     put value(the text of field "count") + 1 into field "Count"
  449.     if the text of field "count" > 215 then
  450.       put "215" into field "Count"
  451.       put the text of cast 215 into field "PrintField"
  452.     else
  453.       put the text of field value(the text of field "count") into field "PrintField"
  454.     end if
  455.   end if
  456.   if gPersonalSelected = 1 then
  457.     set NumOfNewRecipes to the number of lines in field "PersonalMenu" - 1
  458.     put value(the text of field "count") + 1 into field "Count"
  459.     if the text of field "count" > NumOfNewRecipes then
  460.       put NumOfNewRecipes into field "Count"
  461.       put the name of cast (NumOfNewRecipes + gLastCast) && RETURN && RETURN && the text of cast (NumOfNewRecipes + gLastCast) into field "PrintField"
  462.       updateStage()
  463.     else
  464.       put the name of cast (value(the text of field "count") + gLastCast) && RETURN && RETURN && the text of cast (value(the text of field "count") + gLastCast) into field "PrintField"
  465.     end if
  466.   end if
  467. end
  468.  
  469. on LastRecipe
  470.   global gPersonalSelected, gLastCast
  471.   set gLastCast to the number of cast "EnterNewRecipe"
  472.   if gPersonalSelected = 0 then
  473.     put value(the text of field "count") - 1 into field "Count"
  474.     if the text of field "count" < 1 then
  475.       put "1" into field "Count"
  476.       put the text of cast 1 into field "PrintField"
  477.     else
  478.       put the text of field value(the text of field "count") into field "PrintField"
  479.     end if
  480.   end if
  481.   if gPersonalSelected = 1 then
  482.     set NumOfNewRecipes to the number of lines in field "PersonalMenu" - 1
  483.     put value(the text of field "count") - 1 into field "Count"
  484.     if the text of field "count" = "0" then
  485.       put "1" into field "Count"
  486.       set RecipeName to the name of cast (gLastCast + 1)
  487.       set RecipeText to the text of cast (gLastCast + 1)
  488.       put RecipeName & RETURN & RETURN & RecipeText into field "Printfield"
  489.       updateStage()
  490.     else
  491.       put the name of cast (value(the text of field "count") + gLastCast) && RETURN && RETURN && the text of cast (value(the text of field "count") + gLastCast) into field "PrintField"
  492.     end if
  493.   end if
  494. end
  495.  
  496. on AddEditRoll
  497.   set roller to 9
  498.   set startCast to the number of cast "AddUp"
  499.   repeat with n = 0 to 1
  500.     if rollOver(roller + n) then
  501.       set the castNum of sprite (roller + n) to startCast + 1 + (n * 3)
  502.       next repeat
  503.     end if
  504.     set the castNum of sprite (roller + n) to startCast + (n * 3)
  505.     updateStage()
  506.   end repeat
  507. end
  508.  
  509. on AddNewRecipe
  510.   global gNewRecipeName
  511.   put the text of field "EnterNewRecipe" into field "NewRecipeField"
  512.   duplicate(cast "NewRecipeField")
  513.   if (the text of field "Title of New Recipe" = EMPTY) or (the text of field "Title of New Recipe" = "Enter the Title of the recipe here") then
  514.     alert("Please name this recipe... THEN click the 'Save' button")
  515.     put "Enter the Title of the recipe here" into field "Title of New Recipe"
  516.     exit
  517.   end if
  518.   set NumOfLines to the number of lines in field "Title of New Recipe"
  519.   if NumOfLines > 1 then
  520.     alert("The Title is too long. One line of text will do.")
  521.     set the text of field "Title of New Recipe" to "Enter the Title of the recipe here"
  522.     exit
  523.   end if
  524.   if (the text of field "EnterNewRecipe" = Blank) or (the text of field "EnterNewRecipe" = "Enter New Recipe Here") then
  525.     alert("Enter your recipe... THEN click the 'Save' button")
  526.     put "Enter New Recipe Here" into field "EnterNewRecipe"
  527.     exit
  528.   end if
  529.   if char 1 to 5 of field "Title of New Recipe" = " " then
  530.     delete char 1 to 5 of field "Title of New Recipe"
  531.   end if
  532.   set the name of cast "NewRecipeField" to the text of field "Title Of New Recipe"
  533.   set gNewRecipeName to the text of field "Title Of New Recipe"
  534.   set the text of field "EnterNewRecipe" to "Enter New Recipe Here"
  535.   set the text of field "Title Of New Recipe" to "Enter the Title of the recipe here"
  536.   updateStage()
  537.   AddTheRecipe()
  538. end
  539.  
  540. on AddTheRecipe
  541.   global gNumber, gNewRecipeName
  542.   if line 1 of field "PersonalMenu" = "EMPTY" then
  543.     delete line 1 of field "PersonalMenu"
  544.   end if
  545.   set gNumber to the number of lines in field "PersonalMenu"
  546.   put gNumber & ") " & gNewRecipeName & RETURN after line gNumber of field "PersonalMenu"
  547.   put the text of field "PersonalMenu" into field "EditField"
  548.   alert("Your recipe has been added successfully!")
  549. end
  550.  
  551. on ResetAll
  552.   global gAddButtonOn
  553.   set the visible of sprite 5 to 0
  554.   set the visible of sprite 6 to 0
  555.   puppetTransition(10, 1, 10)
  556.   updateStage()
  557.   set the text of field "Title Of New Recipe" to "Enter the Title of the recipe here"
  558.   set the castNum of sprite 5 to the number of cast "Title Of New Recipe"
  559.   set the castNum of sprite 6 to the number of cast "EnterNewRecipe"
  560.   set the visible of sprite 5 to 1
  561.   set the visible of sprite 6 to 1
  562.   set the castNum of sprite 12 to the number of cast "One"
  563.   puppetTransition(1, 1, 10)
  564.   set the visible of sprite 14 to 0
  565.   updateStage()
  566.   set gAddButtonOn to 1
  567. end
  568.  
  569. on EditRecipe
  570.   global gOldTitleOfRecipe, gAddButtonOn
  571.   set the visible of sprite 16 to 0
  572.   set the castNum of sprite 12 to the number of cast "Dot"
  573.   puppetTransition(6, 1, 5)
  574.   updateStage()
  575.   set the castNum of sprite 12 to the number of cast "Two"
  576.   puppetTransition(5, 1, 5)
  577.   updateStage()
  578.   set the castNum of sprite 6 to the number of cast "Dot"
  579.   puppetTransition(9, 1, 5)
  580.   updateStage()
  581.   set the castNum of sprite 6 to the number of cast "EditField"
  582.   set the editableText of sprite 5 to 0
  583.   put "Edit Mode" into field "Title Of New Recipe"
  584.   puppetTransition(10, 1, 5)
  585.   updateStage()
  586.   set gAddButtonOn to 0
  587. end
  588.  
  589. on SelectTheTextToEdit
  590.   global theChoice, gOpenGates, gRecipeToEditTitle, gOldTitleOfRecipe, gTheSelectedLineNumber, theText
  591.   set newLine to the mouseLine
  592.   set the foreColor of line newLine of field "EditField" to 35
  593.   puppetSound("Click2")
  594.   updateStage()
  595.   wait(30)
  596.   set the foreColor of line newLine of field "EditField" to 5
  597.   wait(40)
  598.   set theText to line newLine of field "EditField"
  599.   set numEnd to offset(")", theText)
  600.   if numEnd > 0 then
  601.     set theSelection to char 1 to numEnd - 1 of theText
  602.     set gRecipeToEditTitle to word 2 to the number of words in theText of theText
  603.     set gTheSelectedLineNumber to char 1 to numEnd - 1 of theText
  604.     set the castNum of sprite 6 to the number of cast "Dot"
  605.     puppetTransition(9, 1, 5)
  606.     updateStage()
  607.     put the text of field gRecipeToEditTitle into field "EditMode"
  608.     set gOldTitleOfRecipe to gRecipeToEditTitle
  609.     put gRecipeToEditTitle into field "Title Of New Recipe"
  610.     set the castNum of sprite 6 to the number of cast "EditMode"
  611.     puppetTransition(10, 1, 5)
  612.     updateStage()
  613.     set the castNum of sprite 12 to the number of cast "Dot"
  614.     puppetTransition(6, 1, 5)
  615.     updateStage()
  616.     set the castNum of sprite 12 to the number of cast "Three"
  617.     puppetTransition(5, 1, 5)
  618.     updateStage()
  619.     set the editableText of sprite 5 to 1
  620.     set the visible of sprite 14 to 1
  621.   else
  622.     exit
  623.   end if
  624. end
  625.  
  626. on EditedRecipe
  627.   global gEditedRecipeName, gOldTitleOfRecipe, gTheSelectedLine
  628.   set the editableText of sprite 5 to 1
  629.   set gEditedRecipeName to the text of cast "Title Of New Recipe"
  630.   set gNumOfLines to the number of lines in field "Title Of New Recipe"
  631.   if gNumOfLines > 1 then
  632.     alert("Title is too long. One line of text will do.")
  633.     set the text of field "Title Of New Recipe" to line 1 of gEditedRecipeName
  634.     exit
  635.   end if
  636.   set the text of cast gOldTitleOfRecipe to the text of cast "EditMode"
  637.   set the name of cast gOldTitleOfRecipe to gEditedRecipeName
  638.   updateStage()
  639.   put value(gTheSelectedLineNumber) & ") " & gEditedRecipeName into line value(gTheSelectedLineNumber) of field "personalMenu"
  640.   set the text of field "EditField" to the text of field "PersonalMenu"
  641.   alert("Your recipe has been edited successfully!")
  642.   ResetAll()
  643.   set the visible of sprite 16 to 1
  644. end
  645.  
  646. on PasteIt
  647.   global WhichIsSelected
  648.   pasteClipBoardInto(cast 2000)
  649.   set WordCount to the number of words in field WhichIsSelected
  650.   put the text of cast 2000 after word WordCount of field WhichIsSelected
  651. end
  652.